package com.bjwl.modules.back.controller;

import com.bjwl.common.utils.R;
import com.bjwl.modules.back.entity.TesbankEntity;
import com.bjwl.modules.back.services.TesbankService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.Map;



/**
 * 题库表
 *
 * @author guoyp
 * @email guoyp2126@163.com
 * @date 2021-11-20 17:22:25
 */
@RestController
@RequestMapping("trc/testbank")
public class TestbankController {
    @Autowired
    private TesbankService tesbankService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        //PageUtils page = tesbankService.queryPage(params);

        return R.ok();
    }



    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody TesbankEntity tesbank){
			tesbankService.save(tesbank);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody TesbankEntity tesbank){
			tesbankService.updateById(tesbank);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("trc:tesbank:delete")
    public R delete(@RequestBody Integer[] ids){
			tesbankService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
